$(document).ready(function() {
var qtVIDEO = document.movie1;


// This runs the dosomething function every 500ms 
var timeoutID = window.setInterval(dosomething, 1000);


//Adjusting layout of page 
$("#timeslider").progressbar({ maxValue: 100, stepping: 1});
$('#timeslider').css('width', '640px');
$('#playerwindow').css({'background-color': '#000000', 'width': '640px', 'height': '360px'});
$('#timeslider').css({ 'height': '10px'});

});


function dosomething() {
	var qtVIDEO = document.movie1;
        $('#debug p').html(qtVIDEO.GetTime() + " " + qtVIDEO.GetEndTime());


        $("#timeslider").progressbar('value', Math.round((qtVIDEO.GetTime()/qtVIDEO.GetEndTime())*100));

        if (qtVIDEO.GetTime() == qtVIDEO.GetEndTime()) {
                alert('done')
                $('#playerwindow p').load('./quicktime.php?id=651');
        }
 }

